var iCount = 0;
/* **********************
   Event Handlers
   These are my custom event handlers to make my
   web application behave the way I went when SWFUpload
   completes different tasks.  These aren't part of the SWFUpload
   package.  They are part of my application.  Without these none
   of the actions SWFUpload makes will show up in my application.
   ********************** */
function fileQueued(file) {
    try {
	    var progress = new FileProgress(file, this.customSettings.progressTarget);
		progress.setStatus("Đang chờ...");
		progress.toggleCancel(true, this);
		$("#btnUpload").show();
	} catch (ex) {
		this.debug(ex);
	}

}

function fileQueueError(file, errorCode, message) {
	try {
		if (errorCode === SWFUpload.QUEUE_ERROR.QUEUE_LIMIT_EXCEEDED) {
			alert("You have attempted to queue too many files.\n" + (message === 0 ? "You have reached the upload limit." : "You may select " + (message > 1 ? "up to " + message + " files." : "one file.")));
			return;
		}

		var progress = new FileProgress(file, this.customSettings.progressTarget);
		progress.setError();
		progress.toggleCancel(false);

		switch (errorCode) {
		case SWFUpload.QUEUE_ERROR.FILE_EXCEEDS_SIZE_LIMIT:
			progress.setStatus("File is too big.");
			this.debug("Error Code: File too big, File name: " + file.name + ", File size: " + file.size + ", Message: " + message);
			break;
		case SWFUpload.QUEUE_ERROR.ZERO_BYTE_FILE:
			progress.setStatus("Cannot upload Zero Byte files.");
			this.debug("Error Code: Zero byte file, File name: " + file.name + ", File size: " + file.size + ", Message: " + message);
			break;
		case SWFUpload.QUEUE_ERROR.INVALID_FILETYPE:
			progress.setStatus("Invalid File Type.");
			this.debug("Error Code: Invalid File Type, File name: " + file.name + ", File size: " + file.size + ", Message: " + message);
			break;
		default:
			if (file !== null) {
				progress.setStatus("Unhandled Error");
			}
			this.debug("Error Code: " + errorCode + ", File name: " + file.name + ", File size: " + file.size + ", Message: " + message);
			break;
		}
	} catch (ex) {
        this.debug(ex);
    }
}

function uploadStart(file) {
	try {
		/* I don't want to do any file validation or anything,  I'll just update the UI and
		return true to indicate that the upload should start.
		It's important to update the UI here because in Linux no uploadProgress events are called. The best
		we can do is say we are uploading.
		 */
		var progress = new FileProgress(file, this.customSettings.progressTarget);
		progress.setStatus("Đang Upload...");
		progress.toggleCancel(true, this);
	}
	catch (ex) {}
	
	return true;
}

function uploadProgress(file, bytesLoaded, bytesTotal) {
	try {
		var percent = Math.ceil((bytesLoaded / bytesTotal) * 100);

		var progress = new FileProgress(file, this.customSettings.progressTarget);
		progress.setProgress(percent);
		progress.SetStatus("Đang Upload... " + percent + " %");	
	} catch (ex) {
		this.debug(ex);
	}
}

function uploadSuccess(file, serverData) {
	try {
		var progress = new FileProgress(file, this.customSettings.progressTarget);
		progress.setComplete();
		progress.setStatus("Thành công.");
		progress.toggleCancel(false);

	} catch (ex) {
		this.debug(ex);
	}
}

function uploadError(file, errorCode, message) {
	try {
		var progress = new FileProgress(file, this.customSettings.progressTarget);
		progress.setError();
		progress.toggleCancel(false);

		switch (errorCode) {
		case SWFUpload.UPLOAD_ERROR.HTTP_ERROR:
			progress.setStatus("Upload Error: " + message);
			this.debug("Error Code: HTTP Error, File name: " + file.name + ", Message: " + message);
			break;
		case SWFUpload.UPLOAD_ERROR.UPLOAD_FAILED:
			progress.setStatus("Upload Failed.");
			this.debug("Error Code: Upload Failed, File name: " + file.name + ", File size: " + file.size + ", Message: " + message);
			break;
		case SWFUpload.UPLOAD_ERROR.IO_ERROR:
			progress.setStatus("Server (IO) Error");
			this.debug("Error Code: IO Error, File name: " + file.name + ", Message: " + message);
			break;
		case SWFUpload.UPLOAD_ERROR.SECURITY_ERROR:
			progress.setStatus("Security Error");
			this.debug("Error Code: Security Error, File name: " + file.name + ", Message: " + message);
			break;
		case SWFUpload.UPLOAD_ERROR.UPLOAD_LIMIT_EXCEEDED:
			progress.setStatus("Upload limit exceeded.");
			this.debug("Error Code: Upload Limit Exceeded, File name: " + file.name + ", File size: " + file.size + ", Message: " + message);
			break;
		case SWFUpload.UPLOAD_ERROR.FILE_VALIDATION_FAILED:
			progress.setStatus("Failed Validation.  Upload skipped.");
			this.debug("Error Code: File Validation Failed, File name: " + file.name + ", File size: " + file.size + ", Message: " + message);
			break;
		case SWFUpload.UPLOAD_ERROR.FILE_CANCELLED:
			progress.setStatus("Cancelled");
			progress.setCancelled();
			break;
		case SWFUpload.UPLOAD_ERROR.UPLOAD_STOPPED:
			progress.setStatus("Stopped");
			break;
		default:
			progress.setStatus("Unhandled Error: " + errorCode);
			this.debug("Error Code: " + errorCode + ", File name: " + file.name + ", File size: " + file.size + ", Message: " + message);
			break;
		}
	} catch (ex) {
        this.debug(ex);
    }
}

// This event comes from the Queue Plugin
function queueComplete(numFilesUploaded) {
    //var status = document.getElementById("divStatus");
    //status.innerHTML = numFilesUploaded + " file" + (numFilesUploaded === 1 ? "" : "s") + " uploaded.";
    setTimeout("reloadPage();", 1500);
}

function reloadPage() {
    location.href = location.href;
}

function uploadComplete(file) {
    
}

function setSize(vType, vId) {
    $("a.selected").attr("class", "normal");
    $("#" + vId).attr("class", "selected");
    var strValue = "";
    var strSize = "";
    switch (vType) {
        case 0:
            break;
        case 1:
            strSize = "475x0__";
            break;
        case 2:
            strSize = "100x0__";
            break;
    }
    for (var i = 1; i <= $(".txtLastIndex").val(); i++) {
        strValue = strDomain + $("#txtFolder_" + i).val() + strSize + $("#txtFileName_" + i).val();
        $("#txtDirectLink_" + i).val(strValue);
        $("#txtBBCode_" + i).val("[URL=" + strDomain + "][IMG]" + strValue + "[/IMG][/URL]");
        $("#txtHTMLCode_" + i).val("<a href=\"" + strDomain + "\" target=\"blank\"><img src=\"" + strValue + "\" alt=\"Up.Meotom.Net upload ảnh miễn phí, nhanh không cần đăng ký\"/> </a>");
    }
}

function addImage(src) {
    /*var sSrc = src.split("|");
    var str = "";
    str = str.concat("<div class=\"UploadActive clearfix\">");
    str = str.concat("  <div class=\"UploadThumbImg\"><img src=\"" + sSrc[0] + "130x0__" + sSrc[1] + "\" width=\"130\" /></div>");
    str = str.concat("  <div class=\"clearfix\" style=\"float:left;width:510px;margin-left:10px;\">");
    str = str.concat("      <div style=\"height:30px;padding-top:4px;\">");
    str = str.concat("          <span class=\"labelFrm\">URL</span><input type=\"text\" style=\"width:400px;\" id=\"txtDirectLink_" + iCount + "\" name=\"txtDirectLink_" + iCount + "\" onclick=\"javascript:this.select();\" />");
    str = str.concat("      </div>");
    str = str.concat("      <div style=\"height:30px;padding-top:4px;\">");
    str = str.concat("          <span class=\"labelFrm\">BBCode</span><input type=\"text\" style=\"width:400px;\" id=\"txtBBCode_" + iCount + "\" name=\"txtBBCode_" + iCount + "\" onclick=\"javascript:this.select();\" />");
    str = str.concat("      </div>");
    str = str.concat("      <div style=\"height:30px;padding-top:4px;\">");
    str = str.concat("          <span class=\"labelFrm\">HTML Code</span><input type=\"text\" style=\"width:400px;\" id=\"txtHTMLCode_" + iCount + "\" name=\"txtHTMLCode_" + iCount + "\" onclick=\"javascript:this.select();\" />");
    str = str.concat("      </div>");
    str = str.concat("      <span class=\"number\">").concat(iCount + 1).concat("</span>");
    str = str.concat("  </div>")
    str = str.concat("</div>");
    str = str.concat("<input type=\"hidden\" id=\"txtFolder_" + iCount + "\" value=\"" + sSrc[0] + "\" />");
    str = str.concat("<input type=\"hidden\" id=\"txtFileName_" + iCount + "\" value=\"" + sSrc[1] + "\" />");
    */
}

function FileProgress(e, c) { this.fileProgressID = e.id; this.opacity = 100; this.height = 0; this.fileProgressWrapper = document.getElementById(this.fileProgressID); if (!this.fileProgressWrapper) { this.fileProgressWrapper = document.createElement("div"); this.fileProgressWrapper.className = "progressWrapper"; this.fileProgressWrapper.id = this.fileProgressID; this.fileProgressElement = document.createElement("div"); this.fileProgressElement.className = "progressContainer"; var f = document.createElement("a"); f.className = "progressCancel"; f.href = "#"; f.style.visibility = "hidden"; f.appendChild(document.createTextNode(" ")); var d = document.createElement("div"); d.className = "progressName"; d.appendChild(document.createTextNode(e.name)); var b = document.createElement("div"); b.className = "progressBarInProgress"; var a = document.createElement("div"); a.className = "progressBarStatus"; a.innerHTML = "&nbsp;"; this.fileProgressElement.appendChild(f); this.fileProgressElement.appendChild(d); this.fileProgressElement.appendChild(a); this.fileProgressElement.appendChild(b); this.fileProgressWrapper.appendChild(this.fileProgressElement); document.getElementById(c).appendChild(this.fileProgressWrapper) } else { this.fileProgressElement = this.fileProgressWrapper.firstChild; this.reset() } this.height = this.fileProgressWrapper.offsetHeight; this.setTimer(null) } FileProgress.prototype.setTimer = function (a) { this.fileProgressElement.FP_TIMER = a }; FileProgress.prototype.getTimer = function (a) { return this.fileProgressElement.FP_TIMER || null }; FileProgress.prototype.reset = function () { this.fileProgressElement.className = "progressContainer"; this.fileProgressElement.childNodes[2].innerHTML = "&nbsp;"; this.fileProgressElement.childNodes[2].className = "progressBarStatus"; this.fileProgressElement.childNodes[3].className = "progressBarInProgress"; this.fileProgressElement.childNodes[3].style.width = "0%"; this.appear() }; FileProgress.prototype.setProgress = function (a) { this.fileProgressElement.className = "progressContainer green"; this.fileProgressElement.childNodes[3].className = "progressBarInProgress"; this.fileProgressElement.childNodes[3].style.width = a + "%"; this.appear() }; FileProgress.prototype.setComplete = function () { this.fileProgressElement.className = "progressContainer blue"; this.fileProgressElement.childNodes[3].className = "progressBarComplete"; this.fileProgressElement.childNodes[3].style.width = ""; var a = this; this.setTimer(setTimeout(function () { a.disappear() }, 10000)) }; FileProgress.prototype.setError = function () { this.fileProgressElement.className = "progressContainer red"; this.fileProgressElement.childNodes[3].className = "progressBarError"; this.fileProgressElement.childNodes[3].style.width = ""; var a = this; this.setTimer(setTimeout(function () { a.disappear() }, 5000)) }; FileProgress.prototype.setCancelled = function () { this.fileProgressElement.className = "progressContainer"; this.fileProgressElement.childNodes[3].className = "progressBarError"; this.fileProgressElement.childNodes[3].style.width = ""; var a = this; this.setTimer(setTimeout(function () { a.disappear() }, 2000)) }; FileProgress.prototype.setStatus = function (a) { this.fileProgressElement.childNodes[2].innerHTML = a }; FileProgress.prototype.toggleCancel = function (a, c) { this.fileProgressElement.childNodes[0].style.visibility = a ? "visible" : "hidden"; if (c) { var b = this.fileProgressID; this.fileProgressElement.childNodes[0].onclick = function () { c.cancelUpload(b); return false } } }; FileProgress.prototype.appear = function () { if (this.getTimer() !== null) { clearTimeout(this.getTimer()); this.setTimer(null) } if (this.fileProgressWrapper.filters) { try { this.fileProgressWrapper.filters.item("DXImageTransform.Microsoft.Alpha").opacity = 100 } catch (a) { this.fileProgressWrapper.style.filter = "progid:DXImageTransform.Microsoft.Alpha(opacity=100)" } } else { this.fileProgressWrapper.style.opacity = 1 } this.fileProgressWrapper.style.height = ""; this.height = this.fileProgressWrapper.offsetHeight; this.opacity = 100; this.fileProgressWrapper.style.display = "" }; FileProgress.prototype.disappear = function () { var f = 15; var b = 4; var d = 30; if (this.opacity > 0) { this.opacity -= f; if (this.opacity < 0) { this.opacity = 0 } if (this.fileProgressWrapper.filters) { try { this.fileProgressWrapper.filters.item("DXImageTransform.Microsoft.Alpha").opacity = this.opacity } catch (a) { this.fileProgressWrapper.style.filter = "progid:DXImageTransform.Microsoft.Alpha(opacity=" + this.opacity + ")" } } else { this.fileProgressWrapper.style.opacity = this.opacity / 100 } } if (this.height > 0) { this.height -= b; if (this.height < 0) { this.height = 0 } this.fileProgressWrapper.style.height = this.height + "px" } if (this.height > 0 || this.opacity > 0) { var c = this; this.setTimer(setTimeout(function () { c.disappear() }, d)) } else { this.fileProgressWrapper.style.display = "none"; this.setTimer(null) } }; var SWFUpload; var swfobject; if (SWFUpload == undefined) { SWFUpload = function (a) { this.initSWFUpload(a) } } SWFUpload.prototype.initSWFUpload = function (b) { try { this.customSettings = {}; this.settings = {}; this.eventQueue = []; this.movieName = "SWFUpload_" + SWFUpload.movieCount++; this.movieElement = null; SWFUpload.instances[this.movieName] = this; this.initSettings(b); this.loadSupport(); if (this.swfuploadPreload()) { this.loadFlash() } this.displayDebugInfo() } catch (a) { delete SWFUpload.instances[this.movieName]; throw a } }; SWFUpload.instances = {}; SWFUpload.movieCount = 0; SWFUpload.version = "2.5.0 2010-01-15 Beta 2"; SWFUpload.QUEUE_ERROR = { QUEUE_LIMIT_EXCEEDED: -100, FILE_EXCEEDS_SIZE_LIMIT: -110, ZERO_BYTE_FILE: -120, INVALID_FILETYPE: -130 }; SWFUpload.UPLOAD_ERROR = { HTTP_ERROR: -200, MISSING_UPLOAD_URL: -210, IO_ERROR: -220, SECURITY_ERROR: -230, UPLOAD_LIMIT_EXCEEDED: -240, UPLOAD_FAILED: -250, SPECIFIED_FILE_ID_NOT_FOUND: -260, FILE_VALIDATION_FAILED: -270, FILE_CANCELLED: -280, UPLOAD_STOPPED: -290, RESIZE: -300 }; SWFUpload.FILE_STATUS = { QUEUED: -1, IN_PROGRESS: -2, ERROR: -3, COMPLETE: -4, CANCELLED: -5 }; SWFUpload.UPLOAD_TYPE = { NORMAL: -1, RESIZED: -2 }; SWFUpload.BUTTON_ACTION = { SELECT_FILE: -100, SELECT_FILES: -110, START_UPLOAD: -120, JAVASCRIPT: -130, NONE: -130 }; SWFUpload.CURSOR = { ARROW: -1, HAND: -2 }; SWFUpload.WINDOW_MODE = { WINDOW: "window", TRANSPARENT: "transparent", OPAQUE: "opaque" }; SWFUpload.RESIZE_ENCODING = { JPEG: -1, PNG: -2 }; SWFUpload.completeURL = function (b) { try { var d = "", a = -1; if (typeof (b) !== "string" || b.match(/^https?:\/\//i) || b.match(/^\//) || b === "") { return b } a = window.location.pathname.lastIndexOf("/"); if (a <= 0) { d = "/" } else { d = window.location.pathname.substr(0, a) + "/" } return d + b } catch (c) { return b } }; SWFUpload.onload = function () { }; SWFUpload.prototype.initSettings = function (a) { this.ensureDefault = function (b, d) { var c = a[b]; if (c != undefined) { this.settings[b] = c } else { this.settings[b] = d } }; this.ensureDefault("upload_url", ""); this.ensureDefault("preserve_relative_urls", false); this.ensureDefault("file_post_name", "Filedata"); this.ensureDefault("post_params", {}); this.ensureDefault("use_query_string", false); this.ensureDefault("requeue_on_error", false); this.ensureDefault("http_success", []); this.ensureDefault("assume_success_timeout", 0); this.ensureDefault("file_types", "*.*"); this.ensureDefault("file_types_description", "All Files"); this.ensureDefault("file_size_limit", 0); this.ensureDefault("file_upload_limit", 0); this.ensureDefault("file_queue_limit", 0); this.ensureDefault("flash_url", "swfupload.swf"); this.ensureDefault("flash9_url", "swfupload_fp9.swf"); this.ensureDefault("prevent_swf_caching", false); this.ensureDefault("button_image_url", ""); this.ensureDefault("button_width", 1); this.ensureDefault("button_height", 1); this.ensureDefault("button_text", ""); this.ensureDefault("button_text_style", "color: #000000; font-size: 16pt;"); this.ensureDefault("button_text_top_padding", 0); this.ensureDefault("button_text_left_padding", 0); this.ensureDefault("button_action", SWFUpload.BUTTON_ACTION.SELECT_FILES); this.ensureDefault("button_disabled", false); this.ensureDefault("button_placeholder_id", ""); this.ensureDefault("button_placeholder", null); this.ensureDefault("button_cursor", SWFUpload.CURSOR.ARROW); this.ensureDefault("button_window_mode", SWFUpload.WINDOW_MODE.WINDOW); this.ensureDefault("debug", false); this.settings.debug_enabled = this.settings.debug; this.settings.return_upload_start_handler = this.returnUploadStart; this.ensureDefault("swfupload_preload_handler", null); this.ensureDefault("swfupload_load_failed_handler", null); this.ensureDefault("swfupload_loaded_handler", null); this.ensureDefault("file_dialog_start_handler", null); this.ensureDefault("file_queued_handler", null); this.ensureDefault("file_queue_error_handler", null); this.ensureDefault("file_dialog_complete_handler", null); this.ensureDefault("upload_resize_start_handler", null); this.ensureDefault("upload_start_handler", null); this.ensureDefault("upload_progress_handler", null); this.ensureDefault("upload_error_handler", null); this.ensureDefault("upload_success_handler", null); this.ensureDefault("upload_complete_handler", null); this.ensureDefault("mouse_click_handler", null); this.ensureDefault("mouse_out_handler", null); this.ensureDefault("mouse_over_handler", null); this.ensureDefault("debug_handler", this.debugMessage); this.ensureDefault("custom_settings", {}); this.customSettings = this.settings.custom_settings; if (!!this.settings.prevent_swf_caching) { this.settings.flash_url = this.settings.flash_url + (this.settings.flash_url.indexOf("?") < 0 ? "?" : "&") + "preventswfcaching=" + new Date().getTime(); this.settings.flash9_url = this.settings.flash9_url + (this.settings.flash9_url.indexOf("?") < 0 ? "?" : "&") + "preventswfcaching=" + new Date().getTime() } if (!this.settings.preserve_relative_urls) { this.settings.upload_url = SWFUpload.completeURL(this.settings.upload_url); this.settings.button_image_url = SWFUpload.completeURL(this.settings.button_image_url) } delete this.ensureDefault }; SWFUpload.prototype.loadSupport = function () { this.support = { loading: swfobject.hasFlashPlayerVersion("9.0.28"), imageResize: swfobject.hasFlashPlayerVersion("10.0.0")} }; SWFUpload.prototype.loadFlash = function () { var d, c, e, f, a; if (!this.support.loading) { this.queueEvent("swfupload_load_failed_handler", ["Flash Player doesn't support SWFUpload"]); return } if (document.getElementById(this.movieName) !== null) { this.support.loading = false; this.queueEvent("swfupload_load_failed_handler", ["Element ID already in use"]); return } d = document.getElementById(this.settings.button_placeholder_id) || this.settings.button_placeholder; if (d == undefined) { this.support.loading = false; this.queueEvent("swfupload_load_failed_handler", ["button place holder not found"]); return } e = (d.currentStyle && d.currentStyle.display || window.getComputedStyle && document.defaultView.getComputedStyle(d, null).getPropertyValue("display")) !== "block" ? "span" : "div"; c = document.createElement(e); f = this.getFlashHTML(); try { c.innerHTML = f } catch (b) { this.support.loading = false; this.queueEvent("swfupload_load_failed_handler", ["Exception loading Flash HTML into placeholder"]); return } a = c.getElementsByTagName("object"); if (!a || a.length > 1 || a.length === 0) { this.support.loading = false; this.queueEvent("swfupload_load_failed_handler", ["Unable to find movie after adding to DOM"]); return } else { if (a.length === 1) { this.movieElement = a[0] } } d.parentNode.replaceChild(c.firstChild, d); if (window[this.movieName] == undefined) { window[this.movieName] = this.getMovieElement() } }; SWFUpload.prototype.getFlashHTML = function (a) { return ['<object id="', this.movieName, '" type="application/x-shockwave-flash" data="', (this.support.imageResize ? this.settings.flash_url : this.settings.flash9_url), '" width="', this.settings.button_width, '" height="', this.settings.button_height, '" class="swfupload">', '<param name="wmode" value="', this.settings.button_window_mode, '" />', '<param name="movie" value="', (this.support.imageResize ? this.settings.flash_url : this.settings.flash9_url), '" />', '<param name="quality" value="high" />', '<param name="allowScriptAccess" value="always" />', '<param name="flashvars" value="' + this.getFlashVars() + '" />', "</object>"].join("") }; SWFUpload.prototype.getFlashVars = function () { var a, b; b = this.buildParamString(); a = this.settings.http_success.join(","); return ["movieName=", encodeURIComponent(this.movieName), "&amp;uploadURL=", encodeURIComponent(this.settings.upload_url), "&amp;useQueryString=", encodeURIComponent(this.settings.use_query_string), "&amp;requeueOnError=", encodeURIComponent(this.settings.requeue_on_error), "&amp;httpSuccess=", encodeURIComponent(a), "&amp;assumeSuccessTimeout=", encodeURIComponent(this.settings.assume_success_timeout), "&amp;params=", encodeURIComponent(b), "&amp;filePostName=", encodeURIComponent(this.settings.file_post_name), "&amp;fileTypes=", encodeURIComponent(this.settings.file_types), "&amp;fileTypesDescription=", encodeURIComponent(this.settings.file_types_description), "&amp;fileSizeLimit=", encodeURIComponent(this.settings.file_size_limit), "&amp;fileUploadLimit=", encodeURIComponent(this.settings.file_upload_limit), "&amp;fileQueueLimit=", encodeURIComponent(this.settings.file_queue_limit), "&amp;debugEnabled=", encodeURIComponent(this.settings.debug_enabled), "&amp;buttonImageURL=", encodeURIComponent(this.settings.button_image_url), "&amp;buttonWidth=", encodeURIComponent(this.settings.button_width), "&amp;buttonHeight=", encodeURIComponent(this.settings.button_height), "&amp;buttonText=", encodeURIComponent(this.settings.button_text), "&amp;buttonTextTopPadding=", encodeURIComponent(this.settings.button_text_top_padding), "&amp;buttonTextLeftPadding=", encodeURIComponent(this.settings.button_text_left_padding), "&amp;buttonTextStyle=", encodeURIComponent(this.settings.button_text_style), "&amp;buttonAction=", encodeURIComponent(this.settings.button_action), "&amp;buttonDisabled=", encodeURIComponent(this.settings.button_disabled), "&amp;buttonCursor=", encodeURIComponent(this.settings.button_cursor)].join("") }; SWFUpload.prototype.getMovieElement = function () { if (this.movieElement == undefined) { this.movieElement = document.getElementById(this.movieName) } if (this.movieElement === null) { throw "Could not find Flash element" } return this.movieElement }; SWFUpload.prototype.buildParamString = function () { var c, b, a = []; b = this.settings.post_params; if (typeof (b) === "object") { for (c in b) { if (b.hasOwnProperty(c)) { a.push(encodeURIComponent(c.toString()) + "=" + encodeURIComponent(b[c].toString())) } } } return a.join("&amp;") }; SWFUpload.prototype.destroy = function () { var a; try { this.cancelUpload(null, false); a = this.cleanUp(); if (a) { try { a.parentNode.removeChild(a) } catch (c) { } } window[this.movieName] = null; SWFUpload.instances[this.movieName] = null; delete SWFUpload.instances[this.movieName]; this.movieElement = null; this.settings = null; this.customSettings = null; this.eventQueue = null; this.movieName = null; return true } catch (b) { return false } }; SWFUpload.prototype.displayDebugInfo = function () { this.debug(["---SWFUpload Instance Info---\n", "Version: ", SWFUpload.version, "\n", "Movie Name: ", this.movieName, "\n", "Settings:\n", "\t", "upload_url:               ", this.settings.upload_url, "\n", "\t", "flash_url:                ", this.settings.flash_url, "\n", "\t", "flash9_url:                ", this.settings.flash9_url, "\n", "\t", "use_query_string:         ", this.settings.use_query_string.toString(), "\n", "\t", "requeue_on_error:         ", this.settings.requeue_on_error.toString(), "\n", "\t", "http_success:             ", this.settings.http_success.join(", "), "\n", "\t", "assume_success_timeout:   ", this.settings.assume_success_timeout, "\n", "\t", "file_post_name:           ", this.settings.file_post_name, "\n", "\t", "post_params:              ", this.settings.post_params.toString(), "\n", "\t", "file_types:               ", this.settings.file_types, "\n", "\t", "file_types_description:   ", this.settings.file_types_description, "\n", "\t", "file_size_limit:          ", this.settings.file_size_limit, "\n", "\t", "file_upload_limit:        ", this.settings.file_upload_limit, "\n", "\t", "file_queue_limit:         ", this.settings.file_queue_limit, "\n", "\t", "debug:                    ", this.settings.debug.toString(), "\n", "\t", "prevent_swf_caching:      ", this.settings.prevent_swf_caching.toString(), "\n", "\t", "button_placeholder_id:    ", this.settings.button_placeholder_id.toString(), "\n", "\t", "button_placeholder:       ", (this.settings.button_placeholder ? "Set" : "Not Set"), "\n", "\t", "button_image_url:         ", this.settings.button_image_url.toString(), "\n", "\t", "button_width:             ", this.settings.button_width.toString(), "\n", "\t", "button_height:            ", this.settings.button_height.toString(), "\n", "\t", "button_text:              ", this.settings.button_text.toString(), "\n", "\t", "button_text_style:        ", this.settings.button_text_style.toString(), "\n", "\t", "button_text_top_padding:  ", this.settings.button_text_top_padding.toString(), "\n", "\t", "button_text_left_padding: ", this.settings.button_text_left_padding.toString(), "\n", "\t", "button_action:            ", this.settings.button_action.toString(), "\n", "\t", "button_cursor:            ", this.settings.button_cursor.toString(), "\n", "\t", "button_disabled:          ", this.settings.button_disabled.toString(), "\n", "\t", "custom_settings:          ", this.settings.custom_settings.toString(), "\n", "Event Handlers:\n", "\t", "swfupload_preload_handler assigned:  ", (typeof this.settings.swfupload_preload_handler === "function").toString(), "\n", "\t", "swfupload_load_failed_handler assigned:  ", (typeof this.settings.swfupload_load_failed_handler === "function").toString(), "\n", "\t", "swfupload_loaded_handler assigned:  ", (typeof this.settings.swfupload_loaded_handler === "function").toString(), "\n", "\t", "mouse_click_handler assigned:       ", (typeof this.settings.mouse_click_handler === "function").toString(), "\n", "\t", "mouse_over_handler assigned:        ", (typeof this.settings.mouse_over_handler === "function").toString(), "\n", "\t", "mouse_out_handler assigned:         ", (typeof this.settings.mouse_out_handler === "function").toString(), "\n", "\t", "file_dialog_start_handler assigned: ", (typeof this.settings.file_dialog_start_handler === "function").toString(), "\n", "\t", "file_queued_handler assigned:       ", (typeof this.settings.file_queued_handler === "function").toString(), "\n", "\t", "file_queue_error_handler assigned:  ", (typeof this.settings.file_queue_error_handler === "function").toString(), "\n", "\t", "upload_resize_start_handler assigned:      ", (typeof this.settings.upload_resize_start_handler === "function").toString(), "\n", "\t", "upload_start_handler assigned:      ", (typeof this.settings.upload_start_handler === "function").toString(), "\n", "\t", "upload_progress_handler assigned:   ", (typeof this.settings.upload_progress_handler === "function").toString(), "\n", "\t", "upload_error_handler assigned:      ", (typeof this.settings.upload_error_handler === "function").toString(), "\n", "\t", "upload_success_handler assigned:    ", (typeof this.settings.upload_success_handler === "function").toString(), "\n", "\t", "upload_complete_handler assigned:   ", (typeof this.settings.upload_complete_handler === "function").toString(), "\n", "\t", "debug_handler assigned:             ", (typeof this.settings.debug_handler === "function").toString(), "\n", "Support:\n", "\t", "Load:                     ", (this.support.loading ? "Yes" : "No"), "\n", "\t", "Image Resize:             ", (this.support.imageResize ? "Yes" : "No"), "\n"].join("")) }; SWFUpload.prototype.addSetting = function (a, b, c) { if (b == undefined) { return (this.settings[a] = c) } else { return (this.settings[a] = b) } }; SWFUpload.prototype.getSetting = function (a) { if (this.settings[a] != undefined) { return this.settings[a] } return "" }; SWFUpload.prototype.callFlash = function (functionName, argumentArray) { var movieElement, returnValue, returnString; argumentArray = argumentArray || []; movieElement = this.getMovieElement(); try { if (movieElement != undefined) { returnString = movieElement.CallFunction('<invoke name="' + functionName + '" returntype="javascript">' + __flash__argumentsToXML(argumentArray, 0) + "</invoke>"); returnValue = eval(returnString) } else { this.debug("Can't call flash because the movie wasn't found.") } } catch (ex) { this.debug("Exception calling flash function '" + functionName + "': " + ex.message) } if (returnValue != undefined && typeof returnValue.post === "object") { returnValue = this.unescapeFilePostParams(returnValue) } return returnValue }; SWFUpload.prototype.selectFile = function () { this.callFlash("SelectFile") }; SWFUpload.prototype.selectFiles = function () { this.callFlash("SelectFiles") }; SWFUpload.prototype.startUpload = function (a) { this.callFlash("StartUpload", [a]) }; SWFUpload.prototype.startResizedUpload = function (b, f, a, c, e, d) { this.callFlash("StartUpload", [b, { width: f, height: a, encoding: c, quality: e, allowEnlarging: d}]) }; SWFUpload.prototype.cancelUpload = function (b, a) { if (a !== false) { a = true } this.callFlash("CancelUpload", [b, a]) }; SWFUpload.prototype.stopUpload = function () { this.callFlash("StopUpload") }; SWFUpload.prototype.requeueUpload = function (a) { return this.callFlash("RequeueUpload", [a]) }; SWFUpload.prototype.getStats = function () { return this.callFlash("GetStats") }; SWFUpload.prototype.setStats = function (a) { this.callFlash("SetStats", [a]) }; SWFUpload.prototype.getFile = function (a) { if (typeof (a) === "number") { return this.callFlash("GetFileByIndex", [a]) } else { return this.callFlash("GetFile", [a]) } }; SWFUpload.prototype.getQueueFile = function (a) { if (typeof (a) === "number") { return this.callFlash("GetFileByQueueIndex", [a]) } else { return this.callFlash("GetFile", [a]) } }; SWFUpload.prototype.addFileParam = function (a, b, c) { return this.callFlash("AddFileParam", [a, b, c]) }; SWFUpload.prototype.removeFileParam = function (a, b) { this.callFlash("RemoveFileParam", [a, b]) }; SWFUpload.prototype.setUploadURL = function (a) { this.settings.upload_url = a.toString(); this.callFlash("SetUploadURL", [a]) }; SWFUpload.prototype.setPostParams = function (a) { this.settings.post_params = a; this.callFlash("SetPostParams", [a]) }; SWFUpload.prototype.addPostParam = function (a, b) { this.settings.post_params[a] = b; this.callFlash("SetPostParams", [this.settings.post_params]) }; SWFUpload.prototype.removePostParam = function (a) { delete this.settings.post_params[a]; this.callFlash("SetPostParams", [this.settings.post_params]) }; SWFUpload.prototype.setFileTypes = function (a, b) { this.settings.file_types = a; this.settings.file_types_description = b; this.callFlash("SetFileTypes", [a, b]) }; SWFUpload.prototype.setFileSizeLimit = function (a) { this.settings.file_size_limit = a; this.callFlash("SetFileSizeLimit", [a]) }; SWFUpload.prototype.setFileUploadLimit = function (a) { this.settings.file_upload_limit = a; this.callFlash("SetFileUploadLimit", [a]) }; SWFUpload.prototype.setFileQueueLimit = function (a) { this.settings.file_queue_limit = a; this.callFlash("SetFileQueueLimit", [a]) }; SWFUpload.prototype.setFilePostName = function (a) { this.settings.file_post_name = a; this.callFlash("SetFilePostName", [a]) }; SWFUpload.prototype.setUseQueryString = function (a) { this.settings.use_query_string = a; this.callFlash("SetUseQueryString", [a]) }; SWFUpload.prototype.setRequeueOnError = function (a) { this.settings.requeue_on_error = a; this.callFlash("SetRequeueOnError", [a]) }; SWFUpload.prototype.setHTTPSuccess = function (a) { if (typeof a === "string") { a = a.replace(" ", "").split(",") } this.settings.http_success = a; this.callFlash("SetHTTPSuccess", [a]) }; SWFUpload.prototype.setAssumeSuccessTimeout = function (a) { this.settings.assume_success_timeout = a; this.callFlash("SetAssumeSuccessTimeout", [a]) }; SWFUpload.prototype.setDebugEnabled = function (a) { this.settings.debug_enabled = a; this.callFlash("SetDebugEnabled", [a]) }; SWFUpload.prototype.setButtonImageURL = function (a) { if (a == undefined) { a = "" } this.settings.button_image_url = a; this.callFlash("SetButtonImageURL", [a]) }; SWFUpload.prototype.setButtonDimensions = function (c, a) { this.settings.button_width = c; this.settings.button_height = a; var b = this.getMovieElement(); if (b != undefined) { b.style.width = c + "px"; b.style.height = a + "px" } this.callFlash("SetButtonDimensions", [c, a]) }; SWFUpload.prototype.setButtonText = function (a) { this.settings.button_text = a; this.callFlash("SetButtonText", [a]) }; SWFUpload.prototype.setButtonTextPadding = function (a, b) { this.settings.button_text_top_padding = b; this.settings.button_text_left_padding = a; this.callFlash("SetButtonTextPadding", [a, b]) }; SWFUpload.prototype.setButtonTextStyle = function (a) { this.settings.button_text_style = a; this.callFlash("SetButtonTextStyle", [a]) }; SWFUpload.prototype.setButtonDisabled = function (a) { this.settings.button_disabled = a; this.callFlash("SetButtonDisabled", [a]) }; SWFUpload.prototype.setButtonAction = function (a) { this.settings.button_action = a; this.callFlash("SetButtonAction", [a]) }; SWFUpload.prototype.setButtonCursor = function (a) { this.settings.button_cursor = a; this.callFlash("SetButtonCursor", [a]) }; SWFUpload.prototype.queueEvent = function (c, a) { var b = this; if (a == undefined) { a = [] } else { if (!(a instanceof Array)) { a = [a] } } if (typeof this.settings[c] === "function") { this.eventQueue.push(function () { this.settings[c].apply(this, a) }); setTimeout(function () { b.executeNextEvent() }, 0) } else { if (this.settings[c] !== null) { throw "Event handler " + c + " is unknown or is not a function" } } }; SWFUpload.prototype.executeNextEvent = function () { var a = this.eventQueue ? this.eventQueue.shift() : null; if (typeof (a) === "function") { a.apply(this) } }; SWFUpload.prototype.unescapeFilePostParams = function (e) { var b = /[$]([0-9a-f]{4})/i, c = {}, d, f, a; if (e != undefined) { for (f in e.post) { if (e.post.hasOwnProperty(f)) { d = f; while ((a = b.exec(d)) !== null) { d = d.replace(a[0], String.fromCharCode(parseInt("0x" + a[1], 16))) } c[d] = e.post[f] } } e.post = c } return e }; SWFUpload.prototype.swfuploadPreload = function () { var a; if (typeof this.settings.swfupload_preload_handler === "function") { a = this.settings.swfupload_preload_handler.call(this) } else { if (this.settings.swfupload_preload_handler != undefined) { throw "upload_start_handler must be a function" } } if (a === undefined) { a = true } return !!a }; SWFUpload.prototype.flashReady = function () { var a = this.cleanUp(); if (!a) { this.debug("Flash called back ready but the flash movie can't be found."); return } this.queueEvent("swfupload_loaded_handler") }; SWFUpload.prototype.cleanUp = function () { var a, c = this.getMovieElement(); try { if (c && typeof (c.CallFunction) === "unknown") { this.debug("Removing Flash functions hooks (this should only run in IE and should prevent memory leaks)"); for (a in c) { try { if (typeof (c[a]) === "function") { c[a] = null } } catch (d) { } } } } catch (b) { } window.__flash__removeCallback = function (e, f) { try { if (e) { e[f] = null } } catch (g) { } }; return c }; SWFUpload.prototype.mouseClick = function () { this.queueEvent("mouse_click_handler") }; SWFUpload.prototype.mouseOver = function () { this.queueEvent("mouse_over_handler") }; SWFUpload.prototype.mouseOut = function () { this.queueEvent("mouse_out_handler") }; SWFUpload.prototype.fileDialogStart = function () { this.queueEvent("file_dialog_start_handler") }; SWFUpload.prototype.fileQueued = function (a) { a = this.unescapeFilePostParams(a); this.queueEvent("file_queued_handler", a) }; SWFUpload.prototype.fileQueueError = function (c, b, a) { c = this.unescapeFilePostParams(c); this.queueEvent("file_queue_error_handler", [c, b, a]) }; SWFUpload.prototype.fileDialogComplete = function (c, b, a) { this.queueEvent("file_dialog_complete_handler", [c, b, a]) }; SWFUpload.prototype.uploadResizeStart = function (b, a) { b = this.unescapeFilePostParams(b); this.queueEvent("upload_resize_start_handler", [b, a.width, a.height, a.encoding, a.quality]) }; SWFUpload.prototype.uploadStart = function (a) { a = this.unescapeFilePostParams(a); this.queueEvent("return_upload_start_handler", a) }; SWFUpload.prototype.returnUploadStart = function (b) { var a; if (typeof this.settings.upload_start_handler === "function") { b = this.unescapeFilePostParams(b); a = this.settings.upload_start_handler.call(this, b) } else { if (this.settings.upload_start_handler != undefined) { throw "upload_start_handler must be a function" } } if (a === undefined) { a = true } a = !!a; this.callFlash("ReturnUploadStart", [a]) }; SWFUpload.prototype.uploadProgress = function (b, a, c) { b = this.unescapeFilePostParams(b); this.queueEvent("upload_progress_handler", [b, a, c]) }; SWFUpload.prototype.uploadError = function (c, b, a) { c = this.unescapeFilePostParams(c); this.queueEvent("upload_error_handler", [c, b, a]) }; SWFUpload.prototype.uploadSuccess = function (c, b, a) { c = this.unescapeFilePostParams(c); this.queueEvent("upload_success_handler", [c, b, a]) }; SWFUpload.prototype.uploadComplete = function (a) { a = this.unescapeFilePostParams(a); this.queueEvent("upload_complete_handler", a) }; SWFUpload.prototype.debug = function (a) { this.queueEvent("debug_handler", a) }; SWFUpload.prototype.debugMessage = function (d) { var b, c, a; if (this.settings.debug) { c = []; if (typeof d === "object" && typeof d.name === "string" && typeof d.message === "string") { for (a in d) { if (d.hasOwnProperty(a)) { c.push(a + ": " + d[a]) } } b = c.join("\n") || ""; c = b.split("\n"); b = "EXCEPTION: " + c.join("\nEXCEPTION: "); SWFUpload.Console.writeLine(b) } else { SWFUpload.Console.writeLine(d) } } }; SWFUpload.Console = {}; SWFUpload.Console.writeLine = function (d) { var a, b; try { a = document.getElementById("SWFUpload_Console"); if (!a) { b = document.createElement("form"); document.getElementsByTagName("body")[0].appendChild(b); a = document.createElement("textarea"); a.id = "SWFUpload_Console"; a.style.fontFamily = "monospace"; a.setAttribute("wrap", "off"); a.wrap = "off"; a.style.overflow = "auto"; a.style.width = "700px"; a.style.height = "350px"; a.style.margin = "5px"; b.appendChild(a) } a.value += d + "\n"; a.scrollTop = a.scrollHeight - a.clientHeight } catch (c) { alert("Exception: " + c.name + " Message: " + c.message) } }; swfobject = function () { var au = "undefined", az = "object", Z = "Shockwave Flash", ad = "ShockwaveFlash.ShockwaveFlash", aC = "application/x-shockwave-flash", Y = "SWFObjectExprInst", ax = "onreadystatechange", al = window, aH = document, aF = navigator, ae = false, af = [aJ], aM = [], ak = [], aj = [], aN, ab, av, ao, ag = false, aR = false, aL, at, aO = true, an = function () { var b = typeof aH.getElementById != au && typeof aH.getElementsByTagName != au && typeof aH.createElement != au, i = aF.userAgent.toLowerCase(), g = aF.platform.toLowerCase(), k = g ? /win/.test(g) : /win/.test(i), j = g ? /mac/.test(g) : /mac/.test(i), a = /webkit/.test(i) ? parseFloat(i.replace(/^.*webkit\/(\d+(\.\d+)?).*$/, "$1")) : false, f = ! +"\v1", e = [0, 0, 0], d = null; if (typeof aF.plugins != au && typeof aF.plugins[Z] == az) { d = aF.plugins[Z].description; if (d && !(typeof aF.mimeTypes != au && aF.mimeTypes[aC] && !aF.mimeTypes[aC].enabledPlugin)) { ae = true; f = false; d = d.replace(/^.*\s+(\S+\s+\S+$)/, "$1"); e[0] = parseInt(d.replace(/^(.*)\..*$/, "$1"), 10); e[1] = parseInt(d.replace(/^.*\.(.*)\s.*$/, "$1"), 10); e[2] = /[a-zA-Z]/.test(d) ? parseInt(d.replace(/^.*[a-zA-Z]+(.*)$/, "$1"), 10) : 0 } } else { if (typeof al.ActiveXObject != au) { try { var c = new ActiveXObject(ad); if (c) { d = c.GetVariable("$version"); if (d) { f = true; d = d.split(" ")[1].split(","); e = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)] } } } catch (h) { } } } return { w3: b, pv: e, wk: a, ie: f, win: k, mac: j} } (), aI = function () { if (!an.w3) { return } if ((typeof aH.readyState != au && aH.readyState == "complete") || (typeof aH.readyState == au && (aH.getElementsByTagName("body")[0] || aH.body))) { aS() } if (!ag) { if (typeof aH.addEventListener != au) { aH.addEventListener("DOMContentLoaded", aS, false) } if (an.ie && an.win) { aH.attachEvent(ax, function () { if (aH.readyState == "complete") { aH.detachEvent(ax, arguments.callee); aS() } }); if (al == top) { (function () { if (ag) { return } try { aH.documentElement.doScroll("left") } catch (a) { setTimeout(arguments.callee, 0); return } aS() })() } } if (an.wk) { (function () { if (ag) { return } if (!/loaded|complete/.test(aH.readyState)) { setTimeout(arguments.callee, 0); return } aS() })() } aA(aS) } } (); function aS() { if (ag) { return } try { var a = aH.getElementsByTagName("body")[0].appendChild(ap("span")); a.parentNode.removeChild(a) } catch (d) { return } ag = true; var b = af.length; for (var c = 0; c < b; c++) { af[c]() } } function ah(a) { if (ag) { a() } else { af[af.length] = a } } function aA(b) { if (typeof al.addEventListener != au) { al.addEventListener("load", b, false) } else { if (typeof aH.addEventListener != au) { aH.addEventListener("load", b, false) } else { if (typeof al.attachEvent != au) { aK(al, "onload", b) } else { if (typeof al.onload == "function") { var a = al.onload; al.onload = function () { a(); b() } } else { al.onload = b } } } } } function aJ() { if (ae) { ac() } else { ai() } } function ac() { var b = aH.getElementsByTagName("body")[0]; var d = ap(az); d.setAttribute("type", aC); var a = b.appendChild(d); if (a) { var c = 0; (function () { if (typeof a.GetVariable != au) { var e = a.GetVariable("$version"); if (e) { e = e.split(" ")[1].split(","); an.pv = [parseInt(e[0], 10), parseInt(e[1], 10), parseInt(e[2], 10)] } } else { if (c < 10) { c++; setTimeout(arguments.callee, 10); return } } b.removeChild(d); a = null; ai() })() } else { ai() } } function ai() { var a = aM.length; if (a > 0) { for (var l = 0; l < a; l++) { var f = aM[l].id; var d = aM[l].callbackFn; var b = { success: false, id: f }; if (an.pv[0] > 0) { var k = aQ(f); if (k) { if (ar(aM[l].swfVersion) && !(an.wk && an.wk < 312)) { aE(f, true); if (d) { b.success = true; b.ref = aw(f); d(b) } } else { if (aM[l].expressInstall && aq()) { var i = {}; i.data = aM[l].expressInstall; i.width = k.getAttribute("width") || "0"; i.height = k.getAttribute("height") || "0"; if (k.getAttribute("class")) { i.styleclass = k.getAttribute("class") } if (k.getAttribute("align")) { i.align = k.getAttribute("align") } var h = {}; var e = k.getElementsByTagName("param"); var j = e.length; for (var c = 0; c < j; c++) { if (e[c].getAttribute("name").toLowerCase() != "movie") { h[e[c].getAttribute("name")] = e[c].getAttribute("value") } } aa(i, h, f, d) } else { aB(k); if (d) { d(b) } } } } } else { aE(f, true); if (d) { var g = aw(f); if (g && typeof g.SetVariable != au) { b.success = true; b.ref = g } d(b) } } } } } function aw(d) { var b = null; var c = aQ(d); if (c && c.nodeName == "OBJECT") { if (typeof c.SetVariable != au) { b = c } else { var a = c.getElementsByTagName(az)[0]; if (a) { b = a } } } return b } function aq() { return !aR && ar("6.0.65") && (an.win || an.mac) && !(an.wk && an.wk < 312) } function aa(b, c, e, d) { aR = true; av = d || null; ao = { success: false, id: e }; var h = aQ(e); if (h) { if (h.nodeName == "OBJECT") { aN = aT(h); ab = null } else { aN = h; ab = e } b.id = Y; if (typeof b.width == au || (!/%$/.test(b.width) && parseInt(b.width, 10) < 310)) { b.width = "310" } if (typeof b.height == au || (!/%$/.test(b.height) && parseInt(b.height, 10) < 137)) { b.height = "137" } aH.title = aH.title.slice(0, 47) + " - Flash Player Installation"; var a = an.ie && an.win ? "ActiveX" : "PlugIn", g = "MMredirectURL=" + al.location.toString().replace(/&/g, "%26") + "&MMplayerType=" + a + "&MMdoctitle=" + aH.title; if (typeof c.flashvars != au) { c.flashvars += "&" + g } else { c.flashvars = g } if (an.ie && an.win && h.readyState != 4) { var f = ap("div"); e += "SWFObjectNew"; f.setAttribute("id", e); h.parentNode.insertBefore(f, h); h.style.display = "none"; (function () { if (h.readyState == 4) { h.parentNode.removeChild(h) } else { setTimeout(arguments.callee, 10) } })() } aG(b, c, e) } } function aB(b) { if (an.ie && an.win && b.readyState != 4) { var a = ap("div"); b.parentNode.insertBefore(a, b); a.parentNode.replaceChild(aT(b), a); b.style.display = "none"; (function () { if (b.readyState == 4) { b.parentNode.removeChild(b) } else { setTimeout(arguments.callee, 10) } })() } else { b.parentNode.replaceChild(aT(b), b) } } function aT(a) { var f = ap("div"); if (an.win && an.ie) { f.innerHTML = a.innerHTML } else { var e = a.getElementsByTagName(az)[0]; if (e) { var d = e.childNodes; if (d) { var c = d.length; for (var b = 0; b < c; b++) { if (!(d[b].nodeType == 1 && d[b].nodeName == "PARAM") && !(d[b].nodeType == 8)) { f.appendChild(d[b].cloneNode(true)) } } } } } return f } function aG(i, a, g) { var f, b = aQ(g); if (an.wk && an.wk < 312) { return f } if (b) { if (typeof i.id == au) { i.id = g } if (an.ie && an.win) { var h = ""; for (var k in i) { if (i[k] != Object.prototype[k]) { if (k.toLowerCase() == "data") { a.movie = i[k] } else { if (k.toLowerCase() == "styleclass") { h += ' class="' + i[k] + '"' } else { if (k.toLowerCase() != "classid") { h += " " + k + '="' + i[k] + '"' } } } } } var l = ""; for (var c in a) { if (a[c] != Object.prototype[c]) { l += '<param name="' + c + '" value="' + a[c] + '" />' } } b.outerHTML = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"' + h + ">" + l + "</object>"; ak[ak.length] = i.id; f = aQ(i.id) } else { var e = ap(az); e.setAttribute("type", aC); for (var j in i) { if (i[j] != Object.prototype[j]) { if (j.toLowerCase() == "styleclass") { e.setAttribute("class", i[j]) } else { if (j.toLowerCase() != "classid") { e.setAttribute(j, i[j]) } } } } for (var d in a) { if (a[d] != Object.prototype[d] && d.toLowerCase() != "movie") { X(e, d, a[d]) } } b.parentNode.replaceChild(e, b); f = e } } return f } function X(a, b, c) { var d = ap("param"); d.setAttribute("name", b); d.setAttribute("value", c); a.appendChild(d) } function ay(b) { var a = aQ(b); if (a && a.nodeName == "OBJECT") { if (an.ie && an.win) { a.style.display = "none"; (function () { if (a.readyState == 4) { aP(b) } else { setTimeout(arguments.callee, 10) } })() } else { a.parentNode.removeChild(a) } } } function aP(a) { var c = aQ(a); if (c) { for (var b in c) { if (typeof c[b] == "function") { c[b] = null } } c.parentNode.removeChild(c) } } function aQ(a) { var b = null; try { b = aH.getElementById(a) } catch (c) { } return b } function ap(a) { return aH.createElement(a) } function aK(a, b, c) { a.attachEvent(b, c); aj[aj.length] = [a, b, c] } function ar(a) { var c = an.pv, b = a.split("."); b[0] = parseInt(b[0], 10); b[1] = parseInt(b[1], 10) || 0; b[2] = parseInt(b[2], 10) || 0; return (c[0] > b[0] || (c[0] == b[0] && c[1] > b[1]) || (c[0] == b[0] && c[1] == b[1] && c[2] >= b[2])) ? true : false } function aD(b, f, e, a) { if (an.ie && an.mac) { return } var g = aH.getElementsByTagName("head")[0]; if (!g) { return } var d = (e && typeof e == "string") ? e : "screen"; if (a) { aL = null; at = null } if (!aL || at != d) { var c = ap("style"); c.setAttribute("type", "text/css"); c.setAttribute("media", d); aL = g.appendChild(c); if (an.ie && an.win && typeof aH.styleSheets != au && aH.styleSheets.length > 0) { aL = aH.styleSheets[aH.styleSheets.length - 1] } at = d } if (an.ie && an.win) { if (aL && typeof aL.addRule == az) { aL.addRule(b, f) } } else { if (aL && typeof aH.createTextNode != au) { aL.appendChild(aH.createTextNode(b + " {" + f + "}")) } } } function aE(a, b) { if (!aO) { return } var c = b ? "visible" : "hidden"; if (ag && aQ(a)) { aQ(a).style.visibility = c } else { aD("#" + a, "visibility:" + c) } } function am(c) { var a = /[\\\"<>\.;]/; var b = a.exec(c) != null; return b && typeof encodeURIComponent != au ? encodeURIComponent(c) : c } var aU = function () { if (an.ie && an.win) { window.attachEvent("onunload", function () { var b = aj.length; for (var a = 0; a < b; a++) { aj[a][0].detachEvent(aj[a][1], aj[a][2]) } var c = ak.length; for (var f = 0; f < c; f++) { ay(ak[f]) } for (var e in an) { an[e] = null } an = null; for (var d in swfobject) { swfobject[d] = null } swfobject = null }) } } (); return { registerObject: function (a, c, e, b) { if (an.w3 && a && c) { var d = {}; d.id = a; d.swfVersion = c; d.expressInstall = e; d.callbackFn = b; aM[aM.length] = d; aE(a, false) } else { if (b) { b({ success: false, id: a }) } } }, getObjectById: function (a) { if (an.w3) { return aw(a) } }, embedSWF: function (i, h, j, a, f, b, d, c, k, e) { var g = { success: false, id: h }; if (an.w3 && !(an.wk && an.wk < 312) && i && h && j && a && f) { aE(h, false); ah(function () { j += ""; a += ""; var o = {}; if (k && typeof k === az) { for (var q in k) { o[q] = k[q] } } o.data = i; o.width = j; o.height = a; var l = {}; if (c && typeof c === az) { for (var p in c) { l[p] = c[p] } } if (d && typeof d === az) { for (var m in d) { if (typeof l.flashvars != au) { l.flashvars += "&" + m + "=" + d[m] } else { l.flashvars = m + "=" + d[m] } } } if (ar(f)) { var n = aG(o, l, h); if (o.id == h) { aE(h, true) } g.success = true; g.ref = n } else { if (b && aq()) { o.data = b; aa(o, l, h, e); return } else { aE(h, true) } } if (e) { e(g) } }) } else { if (e) { e(g) } } }, switchOffAutoHideShow: function () { aO = false }, ua: an, getFlashPlayerVersion: function () { return { major: an.pv[0], minor: an.pv[1], release: an.pv[2]} }, hasFlashPlayerVersion: ar, createSWF: function (a, c, b) { if (an.w3) { return aG(a, c, b) } else { return undefined } }, showExpressInstall: function (a, d, b, c) { if (an.w3 && aq()) { aa(a, d, b, c) } }, removeSWF: function (a) { if (an.w3) { ay(a) } }, createCSS: function (d, a, c, b) { if (an.w3) { aD(d, a, c, b) } }, addDomLoadEvent: ah, addLoadEvent: aA, getQueryParamValue: function (d) { var a = aH.location.search || aH.location.hash; if (a) { if (/\?/.test(a)) { a = a.split("?")[1] } if (d == null) { return am(a) } var c = a.split("&"); for (var b = 0; b < c.length; b++) { if (c[b].substring(0, c[b].indexOf("=")) == d) { return am(c[b].substring((c[b].indexOf("=") + 1))) } } } return "" }, expressInstallCallback: function () { if (aR) { var a = aQ(Y); if (a && aN) { a.parentNode.replaceChild(aN, a); if (ab) { aE(ab, true); if (an.ie && an.win) { aN.style.display = "block" } } if (av) { av(ao) } } aR = false } } } } (); swfobject.addDomLoadEvent(function () { if (typeof (SWFUpload.onload) === "function") { SWFUpload.onload.call(window) } }); var SWFUpload; if (typeof (SWFUpload) === "function") { SWFUpload.queue = {}; SWFUpload.prototype.initSettings = (function (a) { return function (b) { if (typeof (a) === "function") { a.call(this, b) } this.queueSettings = {}; this.queueSettings.queue_cancelled_flag = false; this.queueSettings.queue_upload_count = 0; this.queueSettings.user_upload_complete_handler = this.settings.upload_complete_handler; this.queueSettings.user_upload_start_handler = this.settings.upload_start_handler; this.settings.upload_complete_handler = SWFUpload.queue.uploadCompleteHandler; this.settings.upload_start_handler = SWFUpload.queue.uploadStartHandler; this.settings.queue_complete_handler = b.queue_complete_handler || null } })(SWFUpload.prototype.initSettings); SWFUpload.prototype.startUpload = function (a) { this.queueSettings.queue_cancelled_flag = false; this.callFlash("StartUpload", [a]) }; SWFUpload.prototype.cancelQueue = function () { this.queueSettings.queue_cancelled_flag = true; this.stopUpload(); var a = this.getStats(); while (a.files_queued > 0) { this.cancelUpload(); a = this.getStats() } }; SWFUpload.queue.uploadStartHandler = function (b) { var a; if (typeof (this.queueSettings.user_upload_start_handler) === "function") { a = this.queueSettings.user_upload_start_handler.call(this, b) } a = (a === false) ? false : true; this.queueSettings.queue_cancelled_flag = !a; return a }; SWFUpload.queue.uploadCompleteHandler = function (d) { var b = this.queueSettings.user_upload_complete_handler; var c; if (d.filestatus === SWFUpload.FILE_STATUS.COMPLETE) { this.queueSettings.queue_upload_count++ } c = true; if (c) { var a = this.getStats(); if (a.files_queued > 0 && this.queueSettings.queue_cancelled_flag === false) { this.startUpload() } else { if (this.queueSettings.queue_cancelled_flag === false) { this.queueEvent("queue_complete_handler", [this.queueSettings.queue_upload_count]); this.queueSettings.queue_upload_count = 0 } else { this.queueSettings.queue_cancelled_flag = false; this.queueSettings.queue_upload_count = 0 } } } } };